package com.guchenbo.study.mvc.servlet31.springboot.jar;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * @Author guchenbo
 * @Date 2019/11/30.
 */
@Controller
@RequestMapping(value = "/study")
public class StudyController {
    protected static final Logger log = LoggerFactory.getLogger(StudyController.class);
    @Resource
    private StudyService studyService;

    public StudyController() {
    }

    @ResponseBody
    @RequestMapping(value = "/")
    public String index(HttpServletResponse response) {
        System.out.println("in study controller");
        studyService.demo();
        return "SpringBoot Servlet 3.0 jar ok";
    }

    @RequestMapping(value = "/p1")
    public String p1() {
        log.info("in p1");
        return "v1";
    }
}
